package chinese_poker;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;

import javax.tools.Diagnostic;

import org.w3c.dom.DOMImplementation;

public class Poker {
	public  static void main(String[] arg0) {
		ArrayList<String> pokerBox=new ArrayList<String>();
		ArrayList<String> colors=new ArrayList<String>();
		ArrayList<String> numbers=new ArrayList<String>();
		
		colors.add("♥");
		colors.add("♦");
		colors.add("♠");
		colors.add("♣");
		
		for(int i=2;i<=10;i++) {
			numbers.add(i+" ");
		}
		
		numbers.add("J");
		numbers.add("Q");
		numbers.add("K");
		numbers.add("A");
		
		for(String color:colors) {
			for(String number:numbers) {
				String card=color+number;
				pokerBox.add(card);
			}
		}
		pokerBox.add("小王");
		pokerBox.add("大王");
		Collections.shuffle(pokerBox);
		
		ArrayList<String> player1=new ArrayList<String>();
		ArrayList<String> player2=new ArrayList<String>();
		ArrayList<String> player3=new ArrayList<String>();
		ArrayList<String> playerdipai=new ArrayList<String>();
		
		for(int i=0;i<pokerBox.size();i++) {
			String card=pokerBox.get(i);
			if(i>=51) {
				playerdipai.add(card);
				
			}else {
				if(i%3==0) {
					player1.add(card);
				}else if(i%3==1) {
					player2.add(card);
				}else {
					player3.add(card);
				}
			}
		}
		System.out.println("玩家1:"+player1);
		System.out.println("玩家2:"+player2);
		System.out.println("玩家3:"+player3);
		System.out.println("底牌:"+playerdipai);

	}
}
